home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / Kubuntu 8.10 / kubuntu-8.10-desktop-i386.iso / casper / filesystem.squashfs / usr / include / asm / sigcontext.h < prev    next >
C/C++ Source or Header  |  2008-10-24  |  3KB  |  146 lines

  1. #ifndef _ASM_X86_SIGCONTEXT_H
  2. #define _ASM_X86_SIGCONTEXT_H
  3.  
  4.  
  5. #include <asm/types.h>
  6.  
  7. #ifdef __i386__
  8. /*
  9.  * As documented in the iBCS2 standard..
  10.  *
  11.  * The first part of "struct _fpstate" is just the normal i387
  12.  * hardware setup, the extra "status" word is used to save the
  13.  * coprocessor status word before entering the handler.
  14.  *
  15.  * Pentium III FXSR, SSE support
  16.  *    Gareth Hughes <gareth@valinux.com>, May 2000
  17.  *
  18.  * The FPU state data structure has had to grow to accommodate the
  19.  * extended FPU state required by the Streaming SIMD Extensions.
  20.  * There is no documented standard to accomplish this at the moment.
  21.  */
  22. struct _fpreg {
  23.     unsigned short significand[4];
  24.     unsigned short exponent;
  25. };
  26.  
  27. struct _fpxreg {
  28.     unsigned short significand[4];
  29.     unsigned short exponent;
  30.     unsigned short padding[3];
  31. };
  32.  
  33. struct _xmmreg {
  34.     unsigned long element[4];
  35. };
  36.  
  37. struct _fpstate {
  38.     /* Regular FPU environment */
  39.     unsigned long    cw;
  40.     unsigned long    sw;
  41.     unsigned long    tag;
  42.     unsigned long    ipoff;
  43.     unsigned long    cssel;
  44.     unsigned long    dataoff;
  45.     unsigned long    datasel;
  46.     struct _fpreg    _st[8];
  47.     unsigned short    status;
  48.     unsigned short    magic;        /* 0xffff = regular FPU data only */
  49.  
  50.     /* FXSR FPU environment */
  51.     unsigned long    _fxsr_env[6];    /* FXSR FPU env is ignored */
  52.     unsigned long    mxcsr;
  53.     unsigned long    reserved;
  54.     struct _fpxreg    _fxsr_st[8];    /* FXSR FPU reg data is ignored */
  55.     struct _xmmreg    _xmm[8];
  56.     unsigned long    padding[56];
  57. };
  58.  
  59. #define X86_FXSR_MAGIC        0x0000
  60.  
  61. /*
  62.  * User-space might still rely on the old definition:
  63.  */
  64. struct sigcontext {
  65.     unsigned short gs, __gsh;
  66.     unsigned short fs, __fsh;
  67.     unsigned short es, __esh;
  68.     unsigned short ds, __dsh;
  69.     unsigned long edi;
  70.     unsigned long esi;
  71.     unsigned long ebp;
  72.     unsigned long esp;
  73.     unsigned long ebx;
  74.     unsigned long edx;
  75.     unsigned long ecx;
  76.     unsigned long eax;
  77.     unsigned long trapno;
  78.     unsigned long err;
  79.     unsigned long eip;
  80.     unsigned short cs, __csh;
  81.     unsigned long eflags;
  82.     unsigned long esp_at_signal;
  83.     unsigned short ss, __ssh;
  84.     struct _fpstate *fpstate;
  85.     unsigned long oldmask;
  86.     unsigned long cr2;
  87. };
  88.  
  89. #else /* __i386__ */
  90.  
  91. /* FXSAVE frame */
  92. /* Note: reserved1/2 may someday contain valuable data. Always save/restore
  93.    them when you change signal frames. */
  94. struct _fpstate {
  95.     __u16    cwd;
  96.     __u16    swd;
  97.     __u16    twd;        /* Note this is not the same as the
  98.                    32bit/x87/FSAVE twd */
  99.     __u16    fop;
  100.     __u64    rip;
  101.     __u64    rdp;
  102.     __u32    mxcsr;
  103.     __u32    mxcsr_mask;
  104.     __u32    st_space[32];    /* 8*16 bytes for each FP-reg */
  105.     __u32    xmm_space[64];    /* 16*16 bytes for each XMM-reg  */
  106.     __u32    reserved2[24];
  107. };
  108.  
  109. /*
  110.  * User-space might still rely on the old definition:
  111.  */
  112. struct sigcontext {
  113.     unsigned long r8;
  114.     unsigned long r9;
  115.     unsigned long r10;
  116.     unsigned long r11;
  117.     unsigned long r12;
  118.     unsigned long r13;
  119.     unsigned long r14;
  120.     unsigned long r15;
  121.     unsigned long rdi;
  122.     unsigned long rsi;
  123.     unsigned long rbp;
  124.     unsigned long rbx;
  125.     unsigned long rdx;
  126.     unsigned long rax;
  127.     unsigned long rcx;
  128.     unsigned long rsp;
  129.     unsigned long rip;
  130.     unsigned long eflags;        /* RFLAGS */
  131.     unsigned short cs;
  132.     unsigned short gs;
  133.     unsigned short fs;
  134.     unsigned short __pad0;
  135.     unsigned long err;
  136.     unsigned long trapno;
  137.     unsigned long oldmask;
  138.     unsigned long cr2;
  139.     struct _fpstate *fpstate;    /* zero when no FPU context */
  140.     unsigned long reserved1[8];
  141. };
  142.  
  143. #endif /* !__i386__ */
  144.  
  145. #endif
  146.